<script setup>
import { ref } from 'vue'

const capsules = ref([
  {
    id: 1,
    title: '给未来的自己',
    content: '希望那时的你已经实现了成为优秀前端工程师的梦想',
    createDate: '2024-03-20',
    openDate: '2025-03-20',
    type: 'letter'
  },
  {
    id: 2,
    title: '毕业季的回忆',
    content: '记录下美好的大学时光',
    createDate: '2024-03-15',
    openDate: '2026-03-15',
    type: 'photo'
  },
  // 更多示例数据...
])
</script>

<template>
  <div class="capsule-list">
    <h1 class="page-title">我的时光胶囊</h1>
    
    <div class="capsules-grid">
      <div v-for="capsule in capsules" 
           :key="capsule.id" 
           class="capsule-card">
        <div class="capsule-type">{{ capsule.type === 'letter' ? '📝' : '📷' }}</div>
        <h3>{{ capsule.title }}</h3>
        <p class="capsule-content">{{ capsule.content }}</p>
        <div class="capsule-dates">
          <span>创建于: {{ capsule.createDate }}</span>
          <span>开启于: {{ capsule.openDate }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.page-title {
  margin-bottom: 2rem;
  color: #2c3e50;
  font-size: 2rem;
}

.capsules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.capsule-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.capsule-card:hover {
  transform: translateY(-5px);
}

.capsule-type {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.capsule-content {
  color: #666;
  margin: 1rem 0;
  line-height: 1.5;
}

.capsule-dates {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #888;
}
</style> 